package basic.jni;

public class JNI {

    {
        System.loadLibrary("ccalljava");
    }

    public native void  callbackAdd();

    public native void callbackHelloFromJava();

    public native void callbackPrintString();

    public native void callbackSayHello();

    public int add(int x,int y){
        System.out.println("x="+x+"y="+y);
        return x+y;
    }
    public  void helloFromJava(){
        System.out.println("hello from java");
    }

    public void printString(){
        System.out.println("printString");
    }
    public static void sayHello(String s){
        System.out.println("TAG"+ "我是java代码中的JNI."
                + "java中的sayHello(String s)静态方法，我被C调用了:"+ s);
    }

    public static void main(String[] args) {
        JNI jni = new JNI();
        jni.callbackAdd();
    }

}
